package com.zhike.controller;

import com.zhike.service.DwsTripBtWindowService;
import com.zhike.service.DwsTripWindowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: zhike
 * @CreateTime: 2024/5/2
 * @Description:
 */
@RestController
@RequestMapping("trip")
public class TripWeekController {

    @Autowired
    private DwsTripWindowService dwsTripWindowService;

    @Autowired
    private DwsTripBtWindowService dwsTripBtWindowService;

    /**
     * 获取最近7日每辆车的平均速度最快的5辆车
     */
    @PostMapping("getAvgSpeedWeek")
    public String getAvgSpeedWeek(@RequestBody String filter){
        return dwsTripWindowService.getAvgSpeedWeek(filter);
    }

    /**
     * 获取最近7日每辆车行驶里程最长的5辆车
     */
    @PostMapping("getMileageWeek")
    public String getMileageWeek(@RequestBody String filter){
        return dwsTripWindowService.getMileageWeek(filter);
    }

    /**
     * 获取最近7日每辆车平均百公里急加减次数
     */
    @PostMapping("getNumWeek")
    public String getNumWeek(@RequestBody String filter){
        return dwsTripWindowService.getNumWeek(filter);
    }

    /**
     * 获取最近7日每种车型平均速度
     */
    @PostMapping("getAvgTypeWeek")
    public String getAvgTypeWeek(@RequestBody String filter){
        return dwsTripBtWindowService.getAvgTypeWeek(filter);
    }

    /**
     * 获取最近7日每种车型的急加减次数
     */
    @PostMapping("getCountTypeWeek")
    public String getCountTypeWeek(@RequestBody String filter){
        return dwsTripBtWindowService.getCountTypeWeek(filter);
    }

    /**
     * 获取最近7日每种品牌平均速度
     */
    @PostMapping("getAvgBrandWeek")
    public String getAvgBrandWeek(@RequestBody String filter){
        return dwsTripBtWindowService.getAvgBrandWeek(filter);
    }

    /**
     * 获取最近7日每种品牌的急加减次数
     */
    @PostMapping("getCountBrandWeek")
    public String getCountBrandWeek(@RequestBody String filter){
        return dwsTripBtWindowService.getCountBrandWeek(filter);
    }
}
